<script setup>
  import { reactive } from "vue";
  import { LoginStore } from '@/store/login';
  import { storeToRefs } from "pinia";
  import { useRouter } from "vue-router";

  const loginRef = storeToRefs(LoginStore());
  const login = LoginStore();
  const router = useRouter();

  const form = reactive({
    name: '',
    id: '',
    group: ''
  });

  const click = () => {
      login.set(form)
      router.push('/home')
  }




</script>

<template>
  <el-form :model="form" label-width="120px">
    <el-form-item label="id">
      <el-input v-model="form.id" />
    </el-form-item>
    <el-form-item label="name">
      <el-input v-model="form.name" />
    </el-form-item>
    <el-form-item label="group">
      <el-input v-model="form.group" />
    </el-form-item>
    <el-form-item label="group">
      <el-button @click="click">登录</el-button>
    </el-form-item>
  </el-form>
</template>

<style scoped>

</style>